import { Component } from '@angular/core';
import { PlayLppService } from '../play-lpp.service';

@Component({
  selector: 'app-style-model',
  templateUrl: './style-model.component.html',
  styleUrls: ['./style-model.component.scss'],
})
export class StyleModelComponent {
  // modellist = this.lppServ.ModelList1;
  showlist = this.lppServ.ModelList1;
  mymodellist = [1, 2];
  constructor(public lppServ: PlayLppService) {}
  ngOnInit(): void {
    this.lppServ.getmodellist();
  }

  clicklist(x: boolean) {
    if (x == true) {
      this.showlist = this.lppServ.ModelList1;
    } else {
      this.showlist = this.mymodellist;
    }
  }
  chooseMYmodel(modelsrc:string,name:string,detail:string) {
    const MyModel = {
      modelsrc: modelsrc,
      name: name,
      detail: detail,
    };
    this.lppServ.MyModel.push(MyModel)
    console.log(this.lppServ.MyModel);
    this.lppServ.clickDiv = false
    const height_box = document.querySelector('.height_box')as HTMLBRElement
    const box = document.querySelector('.Section_2-55')as HTMLBRElement
    box.style.height = ( height_box.offsetHeight + 200) + 'px';
  }
}
